#include <stdio.h>
#include <assert.h>

#include "instruction.h"
#include "aba_memory.h"
#include "core.h"

void usage()
{
	printf("Abacusim v0.0.1 by John M. Ye\n");
}

unsigned int code[] = {
	0x0000FF00, 0x0EFF000F, 0xEF0000CD, 0xEF0000DC, 
	0x0000FFFF, 0x00FF000F, 0x00000000, 0x00000000
};

int main(int argc, char* argv[])
{
	usage();
	char memory[MAXMEM];
	Core core;
	init_memory(memory, 1000);
	load_code(code, memory, 40, 32);
	dump_memory(memory,  0, 22);

	init_core(&core, memory, 40);

	printf("pc->inst: op rs rt rd shamt funct\n");
	while (!halted(&core))
	       core.clock(&core);

	return 0;
}
